package com.zjj.spring.read.xml.aop.springaop;

import org.springframework.aop.framework.ProxyFactory;

import com.zjj.spring.read.xml.aop.Greeting;
import com.zjj.spring.read.xml.aop.GreetingImpl;

public class SpringAOPTest {

	
	public static void main(String[] args) {
		
		ProxyFactory proxyFactory = new ProxyFactory();
		
		proxyFactory.setTarget(new GreetingImpl());
		
		proxyFactory.addAdvice(new GreetingBeforeAdvice());
		proxyFactory.addAdvice(new GreetingAfterAdvice());
		
		proxyFactory.addAdvice(new GreetingBeforeAfterAdvice());
		
		proxyFactory.addAdvice(new GreetingAroundAdvice());
		proxyFactory.addAdvice(new GreetingThrowAdvice());
		
		
		Greeting greeting = (Greeting) proxyFactory.getProxy();
		System.out.println(greeting.hello("zjj"));
		System.out.println(greeting.except("fffffff"));
		
		
	}
	
}
